package com.hancher.common.javautil;

import java.util.List;

/**
 * 作者 : Hancher ytu_shaoweijie@163.com <br/>
 * 时间 : 2023/6/13 9:17 <br/>
 * 描述 :
 */
public class EmptyUtil {
    public static boolean isEmpty(List list) {
        return list == null || list.size() == 0;
    }

    public static boolean isNotEmpty(List list) {
        return list != null && list.size() != 0;
    }

    public static boolean isEmpty(CharSequence str) {
        return str == null || str.length() == 0;
    }

    public static boolean isNotEmpty(CharSequence str) {
        return str != null && str.length() != 0;
    }

    public static boolean allNotEmpty(CharSequence... str) {
        for (int i = 0; i < str.length; i++) {
            if (str[i] == null || str[i].length() == 0) {
                return false;
            }
        }
        return true;
    }

    public static boolean haveEmpty(CharSequence... str) {
        for (int i = 0; i < str.length; i++) {
            if (str[i] == null || str[i].length() == 0) {
                return true;
            }
        }
        return false;
    }
}
